<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class UpdataColumnDataToApppageRectplDatasTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('apppage_rectpl_datas', function (Blueprint $table) {
            // 删除数据字段
            if (Schema::hasColumn('apppage_rectpl_datas', 'data')) {
                $table->dropColumn('data');
            }
            $table->string('page_mode')->nullable()->after('data_id')->comment('页面跳转方式');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
